package com.gtw.observer.java;

import java.util.Observable;
import java.util.Observer;

public class TVStation extends Observable {

    private String programmeName;

    @Override
    public synchronized void addObserver(Observer o) {
        super.addObserver(o);
    }

    public void play(String programmeName) {
        this.programmeName = programmeName;
        setChanged();
        notifyObservers(this);
    }

    public String getProgrammeName() {
        return programmeName;
    }
}
